#include<stdio.h>
int main()
{
	double eps;
	scanf("%lf",&eps);
	int k=1;
	double result=1;
	while(1)
	{
		if((1.0/(2*k+1))<eps)
		{
			break;
		}
		else
		{
			if(k%2!=0)
			{
				result=result-1.0/(2*k+1);
				k++;
			}
			else
			{
				result=result+1.0/(2*k+1);
				k++;
			}
		}
	}
	printf("%.8lf",4*result);
	return 0;
}
